package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.ManyToOne;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.TemporalType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.SequenceGenerator;

/**
 * 任务用户表
 * OffTaskUser. @author hond
 */
@Entity
@Table(name = "OFF_TASK_USER")//任务 用户表
public class OffTaskUser implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
    private Long id;
	private OffTask task;   //任务id
	private SysEmployee rusr;   //接收用户id
	private Date sendtime;    //发送时间
	private Integer isrecieve;//是否查收：1是2否
	private Date recievetime; //查收时间
	private Double rate;      //完成率

	// Constructors

	/** default constructor */
	public OffTaskUser() {
	}
	
	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_OFFTASKUSER_ID",sequenceName="SQ_OFFTASKUSER_ID",allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_OFFTASKUSER_ID")
	public Long getId() {
	    return id;
	}

    public void setId(Long id){
	    this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "TASK_ID")
	public OffTask getTask() {
		return this.task;
	}

	public void setTask(OffTask task) {
		this.task = task;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "RUSR_ID")
	public SysEmployee getRusr() {
		return this.rusr;
	}

	public void setRusr(SysEmployee rusr) {
		this.rusr = rusr;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "SENDTIME", length = 7)
	public Date getSendtime() {
		return this.sendtime;
	}

	public void setSendtime(Date sendtime) {
		this.sendtime = sendtime;
	}

	@Column(name = "ISRECIEVE", precision = 1, scale = 0)
	public Integer getIsrecieve() {
		return this.isrecieve;
	}

	public void setIsrecieve(Integer isrecieve) {
		this.isrecieve = isrecieve;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "RECIEVETIME", length = 7)
	public Date getRecievetime() {
		return this.recievetime;
	}

	public void setRecievetime(Date recievetime) {
		this.recievetime = recievetime;
	}

	@Column(name = "RATE", precision = 4, scale = 3)
	public Double getRate() {
		return this.rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

}